﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Valentia.Kinection.Service.Manager
{
    /// <summary>
    /// This form is used to adjust Kinect device direction
    /// </summary>
    public partial class AdjustKinectDevice : Form
    {
        #region Declarations

        /// <summary>
        /// This delegate is defined to intimate controller about the command type
        /// </summary>
        /// <param name="moveDeviceUp">Specifies movement direction Up/Down (true/false)</param>
        public delegate void dlgMoveDevice(bool moveDeviceUp);

        /// <summary>
        /// This event is used to intimate controller to send command to adjust Kinect device
        /// </summary>
        public event dlgMoveDevice evtMoveDevice;

        #endregion

        #region Constructor

        /// <summary>
        /// Constructor.
        /// </summary>
        public AdjustKinectDevice()
        {
            InitializeComponent();
        }

        #endregion

        #region Form Control Events

        /// <summary>
        /// Occurs when move up button clicked
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Event Args</param>
        private void btnMoveUp_Click(object sender, EventArgs e)
        {
            if (evtMoveDevice != null)
            {
                evtMoveDevice(true);
            }
        }

        /// <summary>
        /// Occurs when move down button clicked
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Event Args</param>
        private void btnMoveDown_Click(object sender, EventArgs e)
        {
            if (evtMoveDevice != null)
            {
                evtMoveDevice(false);
            }
        }

        #endregion
    }
}
